import './index.scss'
import { Link } from 'react-router-dom'
import { Image } from 'antd-mobile'
type Props = {
    src?: string
    alt?: string
    title?: string
    desc?:string
    link:string
    classname?: string
}

const GeneralCard = (props: Props) => { 
    const { src, alt, title, desc, link, classname } = props
    return (

    <div className={classname}>
        <div className='item'>
            {/* 图片 */}
            <div className='pic-item'>
                <div className='pic-box'>
                    <Link to={link}>
                        {/* <img src={src} alt={alt} /> */}
                        <Image lazy src={src} alt={alt}  fit='cover' className='img' />
                    </Link>

                </div>

            </div>

            {/* 标题/描述/more */}
            <div className='title'>
                <Link to={link} >
                    <h4>{title}</h4>
                    {/* <span className='name'>{title}</span> */}
                    <p>{desc}</p>
                    <div className="learn-more">
                        <span className="more">Read more</span>
                        <span className="iconfont icon-right"></span>
                    </div>
                </Link>
            </div>
        </div>
    </div>
    )
}

export default GeneralCard